package com.qf.service.impl;

import com.qf.dao.UserDao;
import com.qf.dao.impl.UserDaoImpl;
import com.qf.model.Card;
import com.qf.model.User;
import com.qf.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao userDao = new UserDaoImpl();
    //检查手机号是否已经注册
    @Override
    public User findUserByU_idcard(String u_idcard) {
        return userDao.findUserByU_idcard(u_idcard);
    }

    @Override
    public User findUserByphone(String phone) {
        return userDao.findUserByphone(phone);
    }

    //添加注册的新用户
    @Override
    public int addUser(String u_phone,String u_pwd,String u_idcard,String u_name) {
        return userDao.addUser(u_phone,u_pwd,u_idcard,u_name);
    }

    //根据用户id查询用户信息
    @Override
    public User findByUid(int uid) {
        return userDao.findByUid(uid);
    }

    //根据用户id修改app余额
    @Override
    public int updateUserBalance(User user) {
        return userDao.updateUserBalance(user);
    }

    //根据用户id查询银行卡信息

    @Override
    public List<Card> findCardByUid(int uid) {
        return userDao.findCardByUid(uid);
    }

    //    //个人信息  修改
    @Override
    public int updateUserByUid(int uid, String u_sex, String u_email, String u_address, String pwd) {
        return userDao.updateUserByUid(uid,u_sex,u_email,u_address,pwd);
    }
}
